package com.fanghuaiming.tsec.order.controller;

import com.fanghuaiming.tsec.order.dao.model.TsecOrder;
import com.fanghuaiming.tsec.order.service.OrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/****
 * @description: 订单服务接口
 * @version:1.0.0
 * @author fanghuaiming
 * @data Created in 2020/11/27 下午2:00
 *
 */
@RestController("order")
@RequestMapping("/order")
@Slf4j
public class OrderController {

    /**
     * 订单服务
     */
    @Autowired
    private OrderService orderService;

    /**
     * @Description: 生成订单（正常访问）
     *
     * @param:
     * @return:
     * @auther: fanghuaiming
     * @date: 2020/11/30 下午6:28
     * @version:1.0.0
     */
    @PostMapping("/createOrder")
    public String createOrder(@RequestBody TsecOrder tsecOrder) {
        log.info("==========订单微服务开始创建订单==========");
        orderService.createOrder(tsecOrder);
        log.info("==========订单微服务创建订单完成==========");
        return "创建订单成功";
    }
}
